package com.jing.service.impl;

import com.jing.mapper.FeedBackMapper;
import com.jing.pojo.FeedBack;
import com.jing.service.FeedBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 陈书憬
 * @version 1.0
 * 2024/9/13
 */
@Service
public class FeedBackServiceImpl implements FeedBackService {

    @Autowired
    private FeedBackMapper feedBackMapper;

    @Override
    public List<FeedBack> list() {
        return feedBackMapper.list();
    }

    @Override
    public void save(Integer userId, String nickname, String message) {
        LocalDateTime createdAt = LocalDateTime.now();
        feedBackMapper.save(userId, nickname, message, createdAt);
    }
}
